<template>
  <ant-modal
    modalWidth="800"
    modalHeight="650"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model
      ref="form"
      :model="form"
      :rules="rules"
      slot="content"
      layout="vertical"
    >
      <a-row :gutter="32">
        <a-col :span="14">
          <a-row :gutter="32">
            <a-col :span="24">
              <a-form-model-item label="考核标题" prop="title">
                <a-input v-model="form.title" placeholder="请输入标题" />
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="截止时间" prop="endTime">
                <a-date-picker
                  v-model="form.endTime"
                  valueFormat="YYYY-MM-DD"
                  :show-today="true"
                  placeholder="选择日期"
                  width="100%"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="考核类型" prop="type">
                <a-select
                  placeholder="请选择考核类型"
                  v-model="form.type"
                  :getPopupContainer="
                    (triggerNode) => {
                      return triggerNode.parentNode || document.body;
                    }
                  "
                  style="width: 100%"
                  allow-clear
                >
                  <a-select-option
                    v-for="(d, index) in typeOptions"
                    :key="index"
                    :value="d.dictValue"
                    >{{ d.dictLabel }}</a-select-option
                  >
                </a-select>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
        <a-col
          :span="10"
          style="border-left: 1.5px solid #ecedee; height: calc(100vh - 45vh)"
        >
          <a-row :gutter="32">
            <a-col :span="24">
              <a-form-model-item label="选择考核对象" prop="">
                <dept-tree
                  ref="deptTree"
                  :deptOptions="deptOptions"
                  :defalutExpandedKeys="expandedKeys"
                  @setDataOptionInfo="setDataOptionInfo"
                  @select="clickDeptNode"
                />
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button @click="cancel"> 取消 </a-button>
      <a-button type="primary" @click="submitForm"> 保存 </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BizAssessInfoAddForm from "./BizAssessInfoForm";
export default {
  ...BizAssessInfoAddForm,
};
</script>
